include('shared.lua')

local matRefraction	= Material( "sprites/gmdm_pickups/base_r" )
local matLight 		= Material( "sprites/gmdm_pickups/light" )

function ENT:Initialize()
	self.Spin=0
end

function ENT:Draw()

	

		local timeToRespawn=math.Clamp(255*(math.Clamp(self:GetActiveTime()-CurTime(),0,5)/5),0,254)
		local realPos=self.Entity:GetPos()
		local bopPos=realPos+Vector(0,0,50)--3*math.sin(CurTime())
		//self.Entity:SetPos(realPos+Vector(0,0,math.random(0,10)*math.sin(CurTime())))
		/*
			scale = 0.005 + cent->currentState.number * 0.00001;
	cent->lerpOrigin[2] += 4 + cos( ( cg.time + 1000 ) *  scale ) * 4;
		*/
		--self.Entity:SetPos(bopPos) -- Make it bop up and down ///////////////////////////// Why is this only moving the 2nd drawmodel????
		
		-- Spin and draw it
		 self.Spin=self.Spin+0.2
		 self.Entity:SetAngles(Angle(0,self.Spin,0))
		-- self.Entity:SetModelWorldScale(Vector(1,1,1))
		-- self.Entity:SetMaterial("")
		 
		 self.Entity:SetColor(255,255,255,255-timeToRespawn)
		 self.Entity:DrawModel()
		
		

	

		--self.Entity:SetPos(realPos) -- uncomment once issue above  with previous setpos is resolved
end
